home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / GNU_C++ / LIB / MTLB49CF.LZH / include / mint / dcntl.h next >
Encoding:
C/C++ Source or Header  |  1999-11-09  |  19.2 KB  |  580 lines

  1. /*
  2.  * This file belongs to FreeMiNT.  It's not in the original MiNT 1.12
  3.  * distribution.  See the file Changes.MH for a detailed log of changes.
  4.  */
  5.  
  6. /*
  7.  * begin:    1998-06
  8.  * last change: 1998-09-07
  9.  * 
  10.  * Author: Frank Naumann - <fnaumann@cs.uni-magdeburg.de>
  11.  * 
  12.  * please send suggestions, patches or bug reports to me or
  13.  * the MiNT mailing list
  14.  * 
  15.  * 
  16.  * Description: Constants for Dcntl() and Fcntl() calls.
  17.  * 
  18.  */
  19.  
  20. # ifndef _DCNTL_H
  21. # define _DCNTL_H
  22.  
  23.  
  24. # ifndef LLONG
  25. # define LLONG
  26. # ifdef __GNUC__
  27. typedef long long                llong;    /* 64bit int */
  28. # else
  29. typedef struct { long hi; unsigned long lo; }    llong;    /* 64bit int */
  30. # endif
  31. # endif
  32.  
  33.  
  34. # define F_DUPFD        0        /* handled by kernel */
  35. # define F_GETFD        1        /* handled by kernel */
  36. # define F_SETFD        2        /* handled by kernel */
  37. /* flag: */
  38. # define FD_CLOEXEC        1        /* close on exec flag */
  39.  
  40. # define F_GETFL        3        /* handled by kernel */
  41. # define F_SETFL        4        /* handled by kernel */
  42. # define F_GETLK        5
  43. # define F_SETLK        6
  44. # define F_SETLKW        7
  45.  
  46. # if 1
  47. struct flock
  48. {
  49.     short    l_type;                /* type of lock */
  50. # define F_RDLCK        0
  51. # define F_WRLCK        1
  52. # define F_UNLCK        3
  53.     short    l_whence;            /* SEEK_SET, SEEK_CUR, SEEK_END */
  54.     long    l_start;            /* start of locked region */
  55.     long    l_len;                /* length of locked region */
  56.     short    l_pid;                /* pid of locking process (F_GETLK only) */
  57. };
  58. # endif
  59.  
  60. # define F_GETOPENS        8        /* handled by kernel */
  61.  
  62. /* jr: structure for F_GETOPENS */
  63. struct listopens
  64. {
  65. # define LO_FILEOPEN        1
  66. # define LO_DIROPEN        2
  67. # define LO_CURDIR        4
  68. # define LO_CURROOT        8
  69.     short    lo_pid;                /* input: first pid to check;
  70.                          * output: who's using it? */
  71.     short    lo_reason;            /* input: bitmask of interesting reasons;
  72.                          * output: why EACCDN? */
  73.     short    lo_flags;            /* file's open flags */
  74. };
  75.  
  76.  
  77. /*
  78.  * Minix-FS
  79.  */
  80.  
  81. # define MFS_VERIFY        0x100        /* minixfs/docs/syscall.doc */
  82. # define  MFS_MAGIC        0x18970431    /* Magic number from MFS_VERIFY */
  83. # define MFS_SYNC        0x101        /* minixfs/docs/syscall.doc */
  84. # define MFS_CINVALID        0x102        /* minixfs/docs/syscall.doc */
  85. # define MFS_FINVALID        0x103        /* minixfs/docs/syscall.doc */
  86. # define MFS_INFO        0x104        /* minixfs/docs/syscall.doc */
  87. # define MFS_USAGE        0x105        /* minixfs/minixfs.h */
  88. # define MFS_IMODE        0x106        /* minixfs/docs/syscall.doc */
  89. # define MFS_GTRANS        0x107        /* minixfs/docs/syscall.doc */
  90. # define MFS_STRANS        0x108        /* minixfs/docs/syscall.doc */
  91. # define MFS_PHYS        0x109        /* minixfs/minixfs.h */
  92. # define MFS_IADDR        0x10a        /* minixfs/docs/syscall.doc */
  93. # define MFS_UPDATE        0x10b        /* minixfs/docs/syscall.doc */
  94. # define MFS_MOUNT        0x10c        /* minixfs/docs/syscall.doc */
  95. # define MFS_UMOUNT        0x10d        /* minixfs/docs/syscall.doc */
  96. # define MFS_LOPEN        0x10e        /* minixfs/docs/syscall.doc */
  97. # define MFS_MKNOD        0x10f        /* minixfs/docs/syscall.doc */
  98.  
  99.  
  100. /*
  101.  * MagiC specific calls for filesystem installation (use group 'm'!)
  102.  */
  103.  
  104. /*# define KER_INSTXFS        0x0200*/    /* mgx_dos.txt */
  105. /*# define KER_SETWBACK        0x0300*/    /* mgx_dos.txt */
  106. /*# define DFS_GETINFO        0x1100*/    /* mgx_dos.txt */
  107. /*# define DFS_INSTDFS        0x1200*/    /* mgx_dos.txt */
  108.  
  109.  
  110. /* 
  111.  * audio device
  112.  * 
  113.  * LMC configuration. Possible values range from 0 (lowest) to 100 (highest)
  114.  * possible value.
  115.  */
  116. # define AIOCSVOLUME    (('A' << 8) | 0)    /* master volume */
  117. # define AIOCSLVOLUME    (('A' << 8) | 1)    /* left channel volume */
  118. # define AIOCSRVOLUME    (('A' << 8) | 2)    /* right channel volume */
  119. # define AIOCSBASS    (('A' << 8) | 3)    /* bass amplification */
  120. # define AIOCSTREBLE    (('A' << 8) | 4)    /* treble amplification */
  121.  
  122. # define AIOCRESET    (('A' << 8) | 5)    /* reset audio hardware */
  123. # define AIOCSYNC    (('A' << 8) | 6)    /* wait until playing done */
  124. # define AIOCGBLKSIZE    (('A' << 8) | 7)    /* get dma block size */
  125.  
  126. # define AIOCSSPEED    (('A' << 8) | 8)    /* set play or record speed */
  127. # define AIOCGSPEED    (('A' << 8) | 9)    /* get play or record speed */
  128. # define AIOCGCHAN    (('A' << 8) | 10)    /* get # of channels */
  129. # define AIOCSCHAN    (('A' << 8) | 11)    /* set # of channels */
  130.  
  131. # define AIOCGFMTS    (('A' << 8) | 12)    /* get supp. sample formats */
  132. # define AIOCSFMT    (('A' << 8) | 13)    /* set sample format */
  133. #  define AFMT_U8    0x00000001L        /* 8 bits, unsigned */
  134. #  define AFMT_S8    0x00000002L        /* 8 bits, signed */
  135. #  define AFMT_ULAW    0x00000004L        /* u law encoding */
  136. #  define AFMT_U16    0x00000008L        /* 16 bits, unsigned */
  137. #  define AFMT_S16    0x00000010L        /* 16 bits, signed */
  138.  
  139.  
  140. /*
  141.  * CD-ROMs
  142.  */
  143.  
  144. # define CDROMREADOFFSET    (('C'<< 8) | 0)        /* cdromio.h */
  145. # define CDROMPAUSE        (('C'<< 8) | 1)        /* cdromio.h */
  146. # define CDROMRESUME        (('C'<< 8) | 2)        /* cdromio.h */
  147. # define CDROMPLAYMSF        (('C'<< 8) | 3)        /* cdromio.h */
  148. # define CDROMPLAYTRKIND    (('C'<< 8) | 4)        /* cdromio.h */
  149. # define CDROMREADTOCHDR    (('C'<< 8) | 5)        /* cdromio.h */
  150. # define CDROMREADTOCENTRY    (('C'<< 8) | 6)        /* cdromio.h */
  151. # define CDROMSTOP        (('C'<< 8) | 7)        /* cdromio.h */
  152. # define CDROMSTART        (('C'<< 8) | 8)        /* cdromio.h */
  153. # define CDROMEJECT        (('C'<< 8) | 9)        /* cdromio.h */
  154. # define CDROMVOLCTRL        (('C'<< 8) | 10)    /* cdromio.h */
  155. # define CDROMSUBCHNL        (('C'<< 8) | 11)    /* cdromio.h */
  156. # define CDROMREADMODE2        (('C'<< 8) | 12)    /* cdromio.h */
  157. # define CDROMREADMODE1        (('C'<< 8) | 13)    /* cdromio.h */
  158. # define CDROMPREVENTREMOVAL    (('C'<< 8) | 14)    /* cdromio.h */
  159. # define CDROMALLOWTREMOVAL    (('C'<< 8) | 15)    /* cdromio.h */
  160. # define CDROMAUDIOCTRL        (('C'<< 8) | 16)    /* cdromio.h */
  161. # define CDROMREADDA        (('C'<< 8) | 17)    /* cdromio.h */
  162.  
  163. # define CDROMGETMCN        (('C'<< 8) | 19)    /* cdromio.h */
  164. # define CDROMGETTISRC        (('C'<< 8) | 20)    /* cdromio.h */
  165.  
  166.  
  167. /*
  168.  * Big-DOS
  169.  */
  170.  
  171. # define DL_SECSIZ    (('D'<< 8) | 0)        /* max. bpb->recsiz */
  172. # define DL_MINFAT    (('D'<< 8) | 1)        /* min. Anzahl FATs */
  173. # define DL_MAXFAT    (('D'<< 8) | 2)        /* max. Anzahl FATs */
  174. # define DL_MINSPC    (('D'<< 8) | 3)        /* min. bpb->clsiz */
  175. # define DL_MAXSPC    (('D'<< 8) | 4)        /* max. bpb->clsiz */
  176. # define DL_CLUSTS    (('D'<< 8) | 5)        /* max. bpb->numcl FAT16 */
  177. # define DL_MAXSEC    (('D'<< 8) | 6)        /* max. number of sectors */
  178. # define DL_DRIVES    (('D'<< 8) | 7)        /* max. number of drives */
  179. # define DL_CLSIZB    (('D'<< 8) | 8)        /* max. bpb->clsizb */
  180. # define DL_RDLEN    (('D'<< 8) | 9)        /* max. (bpb->rdlen * bpb->recsiz / 32) */
  181. # define DL_FSIZ    (('D'<< 8) | 10)    /* max. bpb->fsiz */
  182. # define DL_FATREC    (('D'<< 8) | 11)    /* max. bpb->fatrec */
  183. # define DL_CLUSTS12    (('D'<< 8) | 12)    /* max. bpb->numcl FAT12 */
  184. # define DL_CLUSTS32    (('D'<< 8) | 13)    /* max. bpb->l_numcl FAT32 */
  185. # define DL_BFLAGS    (('D'<< 8) | 14)    /* supported bits in bpb->bflags */
  186. # define DL_FILESYS    (('D'<< 8) | 15)    /* cookie of the filesystem */
  187. # define DL_VERSION    (('D'<< 8) | 16)    /* version of the filesystem */
  188. # define DL_CHAR    (('D'<< 8) | 17)    /* pointer to a string with legal chars */
  189. # define DL_SETCHAR    (('D'<< 8) | 18)    /* ask or set valid names */
  190.  
  191.  
  192. /*
  193.  * file
  194.  */
  195.  
  196. # define FSTAT        (('F'<< 8) | 0)        /* handled by kernel */
  197. # define FIONREAD    (('F'<< 8) | 1)
  198. # define FIONWRITE    (('F'<< 8) | 2)
  199. # define FUTIME        (('F'<< 8) | 3)
  200.  
  201. /* structure for FUTIME */
  202. struct mutimbuf
  203. {
  204.     unsigned short actime, acdate;        /* GEMDOS format */
  205.     unsigned short modtime, moddate;
  206. };
  207.  
  208. # define FTRUNCATE    (('F'<< 8) | 4)
  209. # define FIOEXCEPT    (('F'<< 8) | 5)
  210.  
  211. # define FSTAT64    (('F'<< 8) | 6)        /* 1.15.4 extension, optional */
  212. # define FUTIME_UTC    (('F'<< 8) | 7)        /* 1.15.4 extension, optional */
  213.  
  214.  
  215. # define FMACOPENRES    (('F'<< 8) | 72)    /* macmint/macfile.h */
  216. # define FMACGETTYCR    (('F'<< 8) | 73)    /* macmint/macfile.h */
  217. # define FMACSETTYCR    (('F'<< 8) | 74)    /* macmint/macfile.h */
  218. # define FMAGICMAC    (('F'<< 8) | 75)    /* (reserved for MagiCMac) */
  219.  
  220.  
  221. /*
  222.  * shared memory
  223.  */
  224.  
  225. # define SHMGETBLK    (('M'<< 8) | 0)
  226. # define SHMSETBLK    (('M'<< 8) | 1)
  227.  
  228.  
  229. /*
  230.  * processes
  231.  */
  232.  
  233. # define PPROCADDR    (('P'<< 8) | 1)
  234. # define PBASEADDR    (('P'<< 8) | 2)
  235. # define PCTXTSIZE    (('P'<< 8) | 3)
  236. # define PSETFLAGS    (('P'<< 8) | 4)
  237. # define PGETFLAGS    (('P'<< 8) | 5)
  238. # define PTRACESFLAGS    (('P'<< 8) | 6)
  239. # define PTRACEGFLAGS    (('P'<< 8) | 7)
  240.  
  241. /* flags: */
  242. # define P_ENABLE    (1 << 0)        /* enable tracing */
  243. # ifdef NOTYETDEFINED
  244. # define P_DOS        (1 << 1)        /* trace DOS calls - unimplemented */
  245. # define P_BIOS        (1 << 2)        /* trace BIOS calls - unimplemented */
  246. # define P_XBIOS    (1 << 3)        /* trace XBIOS calls - unimplemented */
  247. # endif
  248.  
  249. # define PTRACEGO    (('P'<< 8) | 8)        /* these 4 must be together */
  250. # define PTRACEFLOW    (('P'<< 8) | 9)
  251. # define PTRACESTEP    (('P'<< 8) | 10)
  252. # define PTRACE11    (('P'<< 8) | 11)
  253. # define PLOADINFO    (('P'<< 8) | 12)
  254. # define PFSTAT        (('P'<< 8) | 13)
  255. # define PMEMINFO    (('P'<< 8) | 14)
  256.  
  257. struct ploadinfo
  258. {
  259.     /* passed */
  260.     unsigned short fnamelen;
  261.     
  262.     /* returned */
  263.     char *cmdlin /* 128 byte */, *fname;
  264. };
  265.  
  266. struct pmeminfo
  267. {
  268.     /* passed */
  269.     unsigned long mem_blocks;
  270.     
  271.     /* returned */
  272.     struct memblk
  273.     {
  274.         unsigned long    loc;
  275.         unsigned long   len;
  276.         unsigned long    flags;
  277.     } **mlist;
  278. };
  279.  
  280.  
  281. /*
  282.  * Socket ioctls: these require MiNT-Net 3.0 (or later)
  283.  */
  284.  
  285. # define SIOCGLOWAT    (('S' << 8) | 1)
  286. # define SIOCSLOWAT    (('S' << 8) | 2)
  287. # define SIOCGHIWAT    (('S' << 8) | 3)
  288. # define SIOCSHIWAT    (('S' << 8) | 4)
  289. # define SIOCSPGRP    (('S' << 8) | 5)
  290. # define SIOCGPGRP    (('S' << 8) | 6)
  291. # define SIOCATMARK    (('S' << 8) | 7)
  292.  
  293. # define SIOCGIFCONF    (('S' << 8) | 12)    /* get iface list */
  294. # define SIOCGIFFLAGS    (('S' << 8) | 13)    /* get flags */
  295. # define SIOCSIFFLAGS    (('S' << 8) | 14)    /* set flags */
  296. # define SIOCGIFADDR    (('S' << 8) | 15)    /* get iface address */
  297. # define SIOCSIFADDR    (('S' << 8) | 16)    /* set iface address */
  298. # define SIOCGIFDSTADDR    (('S' << 8) | 17)    /* get iface remote address */
  299. # define SIOCSIFDSTADDR    (('S' << 8) | 18)    /* set iface remotw address */
  300. # define SIOCGIFBRDADDR    (('S' << 8) | 19)    /* get iface ibroadcast address */
  301. # define SIOCSIFBRDADDR    (('S' << 8) | 20)    /* set iface broadcast address */
  302. # define SIOCGIFNETMASK    (('S' << 8) | 21)    /* get iface network mask */
  303. # define SIOCSIFNETMASK    (('S' << 8) | 22)    /* set iface network mask */
  304. # define SIOCGIFMETRIC    (('S' << 8) | 23)    /* get metric */
  305. # define SIOCSIFMETRIC    (('S' << 8) | 24)    /* set metric */
  306.  
  307. # define SIOCGIFMTU    (('S' << 8) | 27)    /* get MTU size */
  308. # define SIOCSIFMTU    (('S' << 8) | 28)    /* set MTU size */
  309.  
  310. # define SIOCADDRT    (('S' << 8) | 30)    /* add routing table entry */
  311. # define SIOCDELRT    (('S' << 8) | 31)    /* delete routing table entry */
  312.  
  313. # define SIOCDARP    (('S' << 8) | 40)    /* delete ARP table entry */
  314. # define SIOCGARP    (('S' << 8) | 41)    /* get ARP table entry */
  315. # define SIOCSARP    (('S' << 8) | 42)    /* set ARP table entry */
  316.  
  317.  
  318. /*
  319.  * terminals
  320.  */
  321.  
  322. # define TIOCGETP    (('T'<< 8) | 0)
  323. # define TIOCSETN    (('T'<< 8) | 1)
  324. # define TIOCGETC    (('T'<< 8) | 2)
  325. # define TIOCSETC    (('T'<< 8) | 3)
  326. # define TIOCGLTC    (('T'<< 8) | 4)
  327. # define TIOCSLTC    (('T'<< 8) | 5)
  328. # define TIOCGPGRP    (('T'<< 8) | 6)
  329. # define TIOCSPGRP    (('T'<< 8) | 7)
  330. # define TIOCFLUSH    (('T'<< 8) | 8)
  331. # define TIOCSTOP    (('T'<< 8) | 9)
  332. # define TIOCSTART    (('T'<< 8) | 10)
  333. # define TIOCGWINSZ    (('T'<< 8) | 11)
  334. # define TIOCSWINSZ    (('T'<< 8) | 12)
  335. # define TIOCGXKEY    (('T'<< 8) | 13)
  336. # define TIOCSXKEY    (('T'<< 8) | 14)
  337. # define TIOCIBAUD    (('T'<< 8) | 18)
  338. # define TIOCOBAUD    (('T'<< 8) | 19)
  339. # define TIOCCBRK    (('T'<< 8) | 20)
  340. # define TIOCSBRK    (('T'<< 8) | 21)
  341. # define TIOCGFLAGS    (('T'<< 8) | 22)
  342. # define TIOCSFLAGS    (('T'<< 8) | 23)
  343. # define TIOCOUTQ    (('T'<< 8) | 24)
  344. # define TIOCSETP    (('T'<< 8) | 25)
  345. # define TIOCHPCL    (('T'<< 8) | 26)
  346. # define TIOCCAR    (('T'<< 8) | 27)
  347. # define TIOCNCAR    (('T'<< 8) | 28)
  348. # define TIOCWONLINE    (('T'<< 8) | 29)
  349. # define TIOCSFLAGSB    (('T'<< 8) | 30)
  350. # define TIOCGSTATE    (('T'<< 8) | 31)
  351. # define TIOCSSTATEB    (('T'<< 8) | 32)
  352. # define TIOCGVMIN    (('T'<< 8) | 33)
  353. # define TIOCSVMIN    (('T'<< 8) | 34)
  354. # define TIOCGHUPCL    (('T'<< 8) | 98)    /* mdm0 ioctls */
  355. # define TIOCSHUPCL    (('T'<< 8) | 99)
  356. # define TIOCGSOFTCAR    (('T'<< 8) | 100)
  357. # define TIOCSSOFTCAR    (('T'<< 8) | 101)
  358.  
  359. # define TIOCBUFFER    (('T'<< 8) | 128)    /* HSMODEM sersoftst.txt */
  360. # define TIOCCTLMAP    (('T'<< 8) | 129)
  361. # define TIOCCTLGET    (('T'<< 8) | 130)
  362. # define TIOCCTLSET    (('T'<< 8) | 131)
  363.  
  364. /* HSMODEM/SerSoft compatible definitions
  365.  * for TIOCCTLMAP/TIOCCTLGET/TIOCCTLSET
  366.  */
  367. # define TIOCMH_LE    0x0001        /* line enable output, output */
  368. # define TIOCMH_DTR    0x0002        /* data terminal ready, output */
  369. # define TIOCMH_RTS    0x0004        /* ready to send */
  370. # define TIOCMH_CTS    0x0008        /* clear to send */
  371. # define TIOCMH_CAR    0x0010        /* data carrier detect, input */
  372. # define TIOCMH_CD    TIOCMH_CAR    /* alternative name */
  373. # define TIOCMH_RNG    0x0020        /* ring indicator, input */
  374. # define TIOCMH_RI    TIOCMH_RNG    /* alternative name */
  375. # define TIOCMH_DSR    0x0040        /* data set ready, input */
  376. # define TIOCMH_LEI    0x0080        /* line enable input, input */
  377. # define TIOCMH_TXD    0x0100        /* Sendedatenleitung, output */
  378. # define TIOCMH_RXD    0x0200        /* Empfangsdatenleitung, input */
  379. # define TIOCMH_BRK    0x0400        /* break detected, pseudo input */
  380. # define TIOCMH_TER    0x0800        /* send failure, pseudo input */
  381. # define TIOCMH_RER    0x1000        /* receive failure, pseudo input */
  382. # define TIOCMH_TBE    0x2000        /* hardware sendbuffer empty, pseudo input */
  383. # define TIOCMH_RBF    0x4000        /* hardware receivebuffer full, pseudo input */
  384.  
  385. # define TIOCCTLSFAST    (('T'<< 8) | 132)    /* HSMODEM sersoftst.txt */
  386. # define TIOCCTLSSLOW    (('T'<< 8) | 133)    /* HSMODEM sersoftst.txt */
  387. # define TIONOTSEND    (('T'<< 8) | 134)
  388. # define TIOCERROR    (('T'<< 8) | 135)
  389.  
  390. # define TIOCSCTTY    (('T'<< 8) | 245)
  391. # define TIOCLBIS    (('T'<< 8) | 246)    /* faked by the MiNT library */
  392. # define TIOCLBIC    (('T'<< 8) | 247)
  393. # define TIOCMGET    (('T'<< 8) | 248)
  394.  
  395. /* bits in longword fetched by TIOCMGET: */
  396. # define TIOCM_LE    0001 /* not supported */
  397. # define TIOCM_DTR    0002
  398. # define TIOCM_RTS    0004
  399. # define TIOCM_ST    0010 /* not supported */
  400. # define TIOCM_SR    0020 /* not supported */
  401. # define TIOCM_CTS    0040
  402. # define TIOCM_CAR    0100
  403. # define TIOCM_CD    TIOCM_CAR
  404. # define TIOCM_RNG    0200
  405. # define TIOCM_RI    TIOCM_RNG
  406. # define TIOCM_DSR    0400 /* not supported */
  407.  
  408. # define TIOCCDTR    (('T'<< 8) | 249)
  409. # define TIOCSDTR    (('T'<< 8) | 250)
  410. # define TIOCNOTTY    (('T'<< 8) | 251)
  411. # define TIOCGETD    (('T'<< 8) | 252)      /* not yet implemented in MiNT */
  412. # define TIOCSETD    (('T'<< 8) | 253)
  413. # define TIOCLGET    (('T'<< 8) | 254)
  414. # define TIOCLSET    (('T'<< 8) | 255)
  415.  
  416. # define NTTYDISC    1
  417.  
  418.  
  419. /*
  420.  * (V)FAT filesystem extensions (MiNT/MagiC)
  421.  */
  422.     
  423. # define VFAT_CNFDFLN    (('V'<< 8) | 0)        /* MiNT/MagiC */
  424. # define VFAT_CNFLN    (('V'<< 8) | 1)        /* MiNT/MagiC */
  425. # define V_CNTR_SLNK    (('V'<< 8) | 2)        /* MiNT, works on FAT and VFAT */
  426. # define V_CNTR_RES3    (('V'<< 8) | 3)        /* reserved, not used at the moment */
  427. # define V_CNTR_MODE    (('V'<< 8) | 4)        /* MiNT, works on FAT */
  428.  
  429. /* name mode flags: */
  430. # define GEMDOS        0
  431. # define ISO        1
  432. # define MSDOS        2
  433.  
  434. # define V_CNTR_FAT32    (('V'<< 8) | 10)    /* MiNT, FAT32 control */
  435.  
  436. struct control_FAT32
  437. {
  438.     unsigned short    mode;    /* 0 = fill out; 1 = set values */
  439.     unsigned short    mirr;    /* FAT mirroring: 0 = enabled, otherwise active FAT */
  440.     unsigned short    fats;    /* number of FATs */
  441.     unsigned short    info;    /* status of additional info sector */
  442. # define FAT32_info_exist    0x1
  443. # define FAT32_info_active    0x2
  444. # define FAT32_info_reset    0x4    /* in set mode: clear info sector */
  445. };
  446.  
  447. # define V_CNTR_WP    (('V'<< 8) | 100)    /* MiNT, write protect control */
  448. # define V_CNTR_WB    (('V'<< 8) | 101)    /* MiNT, write back control */
  449.  
  450.  
  451. /*
  452.  * Ext2 filesystem extensions
  453.  */
  454.  
  455. # define EXT2_IOC_GETFLAGS    (('f'<< 8) | 1)
  456. # define EXT2_IOC_SETFLAGS    (('f'<< 8) | 2)
  457. # define EXT2_IOC_GETVERSION    (('v'<< 8) | 1)
  458. # define EXT2_IOC_SETVERSION    (('v'<< 8) | 2)
  459.  
  460.  
  461. /*
  462.  * cursor control
  463.  */
  464.  
  465. # define TCURSOFF    (('c'<< 8) | 0)
  466. # define TCURSON    (('c'<< 8) | 1)
  467. # define TCURSBLINK    (('c'<< 8) | 2)
  468. # define TCURSSTEADY    (('c'<< 8) | 3)
  469. # define TCURSSRATE    (('c'<< 8) | 4)
  470. # define TCURSGRATE    (('c'<< 8) | 5)
  471. # define TCURSSDELAY    (('c'<< 8) | 6)        /* undocumented! */
  472. # define TCURSGDELAY    (('c'<< 8) | 7)        /* undocumented! */
  473.  
  474.  
  475. /*
  476.  * MagiC opcodes (all group 'm' opcodes are reserved for MagiC)
  477.  */
  478.  
  479. # define MX_KER_GETINFO        (('m'<< 8) | 0)        /* mgx_dos.txt */
  480. # define MX_KER_DOSLIMITS    (('m'<< 8) | 1)        /* mgx_dos.txt */
  481. # define MX_KER_INSTXFS        (('m'<< 8) | 2)        /* mgx_dos.txt */
  482. # define MX_KER_DRVSTAT        (('m'<< 8) | 4)        /* mgx_dos.txt */
  483. # define MX_KER_XFSNAME        (('m'<< 8) | 5)        /* mgx_dos.txt */
  484. # define MX_DEV_INSTALL     (('m'<< 8) | 0x20)    /* mgx_dos.txt */
  485. # define MX_DFS_GETINFO        (('m'<< 8) | 0x40)    /* mgx_dos.txt */
  486. # define MX_DFS_INSTDFS        (('m'<< 8) | 0x41)    /* mgx_dos.txt */
  487.  
  488.  
  489. /*
  490.  * Printers (whole range reserved)
  491.  */
  492.  
  493. /*# define PNVDI        (('p'<< 8) | *)*/    /* NVDI programmer's manual */
  494.  
  495.  
  496. /*
  497.  * MagiC specific calls for device driver installation (use group 'm'!)
  498.  */
  499.  
  500. /*# define PROC_CREATE        0xcc00*/        /* mgx_dos.txt */
  501. /*# define DEV_M_INSTALL    0xcd00*/        /* mgx_dos.txt */
  502.  
  503.  
  504. /*
  505.  * device driver installation
  506.  */
  507.  
  508. # define DEV_NEWTTY    0xde00
  509. # define DEV_NEWBIOS    0xde01
  510. # define DEV_INSTALL    0xde02
  511.  
  512.  
  513. /*
  514.  * filesystem installation
  515.  */
  516.  
  517. # define FS_INSTALL    0xf001        /* let the kernel know about the file system */
  518. # define FS_MOUNT    0xf002        /* make a new directory for a file system */
  519. # define FS_UNMOUNT    0xf003        /* remove a directory for a file system */
  520. # define FS_UNINSTALL    0xf004        /* remove a file system from the list */
  521.  
  522. /*
  523.  * filesystem information
  524.  */
  525.  
  526. # define FS_INFO    0xf100        /* xfs fill out the following struct */
  527.  
  528. struct fs_info
  529. {
  530.     char    name [32];    /* name of the xfs (same as MX_KER_XFSNAME but more space) */
  531.     long    version;    /* upper word: major version; lower word: minor version */
  532.     long    type;        /* upper word: major type; lower word: minor type */
  533.     char    type_asc[32];    /* human readable version of type */
  534. };
  535.  
  536. /* values of fs_info.type */
  537. # define _MAJOR_FAT    (1L << 16)
  538. # define _MAJOR_VFAT    (2L << 16)
  539. # define _MAJOR_MINIX    (3L << 16)
  540. # define _MAJOR_RAMFS    (4L << 16)
  541. # define _MAJOR_EXT2     (5L << 16)
  542. # define _MAJOR_HSIERRA    (6L << 16)
  543. # define _MAJOR_ISO9660    (7L << 16)
  544. # define _MAJOR_JOLIET    (8L << 16)
  545. # define _MAJOR_HFS    (9L << 16)
  546. # define _MAJOR_CDRAW    (10L << 16)
  547. # define _MAJOR_STONX    (11L << 16)
  548.  
  549. # define FS_OLDTOS    (0L)            /* default/unknown */
  550. # define FS_FAT12    (_MAJOR_FAT  | 0)    /* MiNT 1.15 */
  551. # define FS_FAT16    (_MAJOR_FAT  | 1)    /* MiNT 1.15 */
  552. # define FS_FAT32    (_MAJOR_FAT  | 2)    /* MiNT 1.15 */
  553. # define FS_VFAT12    (_MAJOR_VFAT | 0)    /* MiNT 1.15 */
  554. # define FS_VFAT16    (_MAJOR_VFAT | 1)    /* MiNT 1.15 */
  555. # define FS_VFAT32    (_MAJOR_VFAT | 2)    /* MiNT 1.15 */
  556. # define FS_MINIX    (_MAJOR_MINIX)        /* MinixFS 0.70p6 */
  557. # define FS_RAMFS    (_MAJOR_RAMFS)        /* fnRamFS 0.52 */
  558. # define FS_EXT2    (_MAJOR_EXT2)        /* Ext2 0.?? */
  559. # define FS_HSIERRA    (_MAJOR_HSIERRA)    /* Spin 0.35 */
  560. # define FS_ISO9660    (_MAJOR_ISO9660)    /* Spin 0.35 */
  561. # define FS_JOLIET    (_MAJOR_JOLIET)        /* Spin 0.35 */
  562. # define FS_HFS        (_MAJOR_HFS)        /* Spin 0.35 */
  563. # define FS_CDRAW    (_MAJOR_CDRAW)        /* Spin 0.35 */
  564. # define FS_STONX    (_MAJOR_STONX)        /* STonXfs4MiNT */
  565.  
  566.  
  567. # define FS_USAGE    0xf101        /* xfs fill out the following struct */
  568.  
  569. struct fs_usage
  570. {
  571.     unsigned long blocksize;/* 32bit: size in bytes of a block */
  572.     llong    blocks;        /* 64bit: number of blocks */
  573.     llong    free_blocks;    /* 64bit: number of free blocks */
  574.     llong    inodes;        /* 64bit: number of inodes or FS_UNLIMITED */
  575.     llong    free_inodes;    /* 64bit: number of free inodes or FS_UNLIMITED */
  576. # define FS_UNLIMITED    -1
  577. };
  578.  
  579. # endif /* _DCNTL_H */
  580.